import React, { useState, useEffect } from 'react';
import ReactDOM from 'react-dom';
import { Column } from '@ant-design/plots';

const TeamColumChart = (prop: any) => {
  const data = [
    {
      TABLE_NAME: 'PAPER',
      USERID: '2018035',
      USERNAME: '李明明',
      COUNT: 1,
    },
    {
      TABLE_NAME: 'HORIZONTAL_PROJECT',
      USERID: '2018035',
      USERNAME: '李明明',
      COUNT: 3,
    },
    {
      TABLE_NAME: 'GRANT_PATENT',
      USERID: '2002092',
      USERNAME: '李永建',
      COUNT: 66,
    },
    {
      TABLE_NAME: 'GRANT_PATENT',
      USERID: '2003032',
      USERNAME: '翁玲',
      COUNT: 16,
    },
    {
      TABLE_NAME: 'INVITATION_REPORT',
      USERID: '2002092',
      USERNAME: '李永建',
      COUNT: 23,
    },
    {
      TABLE_NAME: 'PAPER',
      USERID: '2003032',
      USERNAME: '翁玲',
      COUNT: 15,
    },
    {
      TABLE_NAME: 'VERTICAL_PROJECT',
      USERID: '1994052',
      USERNAME: '黄文美',
      COUNT: 4,
    },
    {
      TABLE_NAME: 'PAPER',
      USERID: '2017024',
      USERNAME: '张长庚',
      COUNT: 9,
    },
    {
      TABLE_NAME: 'REWARD',
      USERID: '2003032',
      USERNAME: '翁玲',
      COUNT: 1,
    },
    {
      TABLE_NAME: 'REWARD',
      USERID: '2017024',
      USERNAME: '张长庚',
      COUNT: 1,
    },
    {
      TABLE_NAME: 'EQUIPMENT_DEVELOP',
      USERID: '2002092',
      USERNAME: '李永建',
      COUNT: 1,
    },
    {
      TABLE_NAME: 'VERTICAL_PROJECT',
      USERID: '2002092',
      USERNAME: '李永建',
      COUNT: 23,
    },
    {
      TABLE_NAME: 'GRANT_PATENT',
      USERID: '1991025',
      USERNAME: '杨文荣',
      COUNT: 19,
    },
    {
      TABLE_NAME: 'GRANT_PATENT',
      USERID: '2017024',
      USERNAME: '张长庚',
      COUNT: 26,
    },
    {
      TABLE_NAME: 'YEAR_AND_OTHER_ACHIEVE',
      USERID: '2002092',
      USERNAME: '李永建',
      COUNT: 3,
    },
    {
      TABLE_NAME: 'YEAR_AND_OTHER_ACHIEVE',
      USERID: '1991025',
      USERNAME: '杨文荣',
      COUNT: 1,
    },
    {
      TABLE_NAME: 'VERTICAL_PROJECT',
      USERID: '2017024',
      USERNAME: '张长庚',
      COUNT: 8,
    },
    {
      TABLE_NAME: 'VERTICAL_PROJECT',
      USERID: '2016009',
      USERNAME: '王坤',
      COUNT: 9,
    },
    {
      TABLE_NAME: 'VERTICAL_PROJECT',
      USERID: '2003032',
      USERNAME: '翁玲',
      COUNT: 2,
    },
    {
      TABLE_NAME: 'HORIZONTAL_PROJECT',
      USERID: '2003032',
      USERNAME: '翁玲',
      COUNT: 2,
    },
    {
      TABLE_NAME: 'BOOK_PUBLISH',
      USERID: '2002092',
      USERNAME: '李永建',
      COUNT: 1,
    },
    {
      TABLE_NAME: 'LAB_STAFF_REPORT',
      USERID: '2018035',
      USERNAME: '李明明',
      COUNT: 1,
    },
    {
      TABLE_NAME: 'EQUIPMENT_DEVELOP',
      USERID: '2017024',
      USERNAME: '张长庚',
      COUNT: 1,
    },
    {
      TABLE_NAME: 'PAPER',
      USERID: '2016009',
      USERNAME: '王坤',
      COUNT: 5,
    },
    {
      TABLE_NAME: 'VERTICAL_PROJECT',
      USERID: '2018035',
      USERNAME: '李明明',
      COUNT: 7,
    },
    {
      TABLE_NAME: 'VERTICAL_PROJECT',
      USERID: '1991025',
      USERNAME: '杨文荣',
      COUNT: 4,
    },
    {
      TABLE_NAME: 'PAPER',
      USERID: '2002092',
      USERNAME: ' 李永建',
      COUNT: 5,
    },
    {
      TABLE_NAME: 'ACHIEVE_TRANS',
      USERID: '2002092',
      USERNAME: '李永建',
      COUNT: 2,
    },
    {
      TABLE_NAME: 'LAB_STAFF_REPORT',
      USERID: '2002092',
      USERNAME: '李永建',
      COUNT: 4,
    },
    {
      TABLE_NAME: 'HORIZONTAL_PROJECT',
      USERID: '2002092',
      USERNAME: '李永建',
      COUNT: 2,
    },
    {
      TABLE_NAME: 'REWARD',
      USERID: '2002092',
      USERNAME: '李永建',
      COUNT: 3,
    },
    {
      TABLE_NAME: 'BOOK_PUBLISH',
      USERID: '2003032',
      USERNAME: '翁玲',
      COUNT: 1,
    },
    {
      TABLE_NAME: 'GRANT_PATENT',
      USERID: '2018035',
      USERNAME: '李明明',
      COUNT: 8,
    },
    {
      TABLE_NAME: 'YEAR_AND_OTHER_ACHIEVE',
      USERID: '2003032',
      USERNAME: '翁玲',
      COUNT: 1,
    },
    {
      TABLE_NAME: 'PAPER',
      USERID: '1991025',
      USERNAME: '杨文荣',
      COUNT: 6,
    },
    {
      TABLE_NAME: 'PAPER',
      USERID: '1994052',
      USERNAME: '黄文美',
      COUNT: 14,
    },
    {
      TABLE_NAME: 'HORIZONTAL_PROJECT',
      USERID: '2017024',
      USERNAME: '张长庚',
      COUNT: 2,
    },
    {
      TABLE_NAME: 'PAPER',
      USERID: '2002092',
      USERNAME: '李永建',
      COUNT: 26,
    },
    {
      TABLE_NAME: 'GRANT_PATENT',
      USERID: '1994052',
      USERNAME: '黄文美',
      COUNT: 7,
    },
    {
      TABLE_NAME: 'INVITATION_REPORT',
      USERID: '2017024',
      USERNAME: '张长庚',
      COUNT: 3,
    },
    {
      TABLE_NAME: 'LAB_STAFF_REPORT',
      USERID: '2017024',
      USERNAME: '张长庚',
      COUNT: 1,
    },
  ];
  const config = {
    data: prop.data || data,
    xField: prop.xField,
    yField: prop.yField,
    seriesField: prop.seriesField,
    isGroup: 'true',
    columnStyle: {
      radius: [20, 20, 0, 0],
    },
  };

  return <Column {...config} />;
};

export default TeamColumChart;
